#ifndef CODE_LINE_VISITOR_CPP
#define CODE_LINE_VISITOR_CPP

#include "stdafx.h"
#include "UmlExt.h"
#include "CodeLineVisitor.h"
#include "CastMap.h"
#include <string>
#include <map>

GOAL::Code_Line_Visitor::Code_Line_Visitor()
{

}

GOAL::Code_Line_Visitor::~Code_Line_Visitor()
{

}

void GOAL::Code_Line_Visitor::Visit_KeyboardConnection(const KeyboardConnection& target)
{

}

void GOAL::Code_Line_Visitor::Visit_VariableRef(const VariableRef& target)
{
	//AfxMessageBox(name.c_str ());
}

void GOAL::Code_Line_Visitor::Visit_Plus(const Plus& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Divide(const Divide& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Times(const Times& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Minus(const Minus& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Modulus(const Modulus& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Function(const Function& target)
{
}

void GOAL::Code_Line_Visitor::Visit_FunctionCall(const FunctionCall& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Class(const Class& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Module(const Module& target)
{
}

void GOAL::Code_Line_Visitor::Visit_CodeAdapter(const CodeAdapter& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ModuleAdapter(const ModuleAdapter& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ClassAdapter(const ClassAdapter& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Not(const Not& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ConditionsAdapter(const ConditionsAdapter& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Assignment(const Assignment& target)
{
}

void GOAL::Code_Line_Visitor::Visit_File(const File& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Console(const Console& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Keyboard(const Keyboard& target)
{
}

void GOAL::Code_Line_Visitor::Visit_AssignmentConnection(const AssignmentConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Brackets(const Brackets& target)
{
}

void GOAL::Code_Line_Visitor::Visit_IndexConnection(const IndexConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_NonModifyingConnection(const NonModifyingConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_For(const For& target)
{
}

void GOAL::Code_Line_Visitor::Visit_While(const While& target)
{
}

void GOAL::Code_Line_Visitor::Visit_If(const If& target)
{
}

void GOAL::Code_Line_Visitor::Visit_PlusEquals(const PlusEquals& target)
{
}

void GOAL::Code_Line_Visitor::Visit_DivideEquals(const DivideEquals& target)
{
}

void GOAL::Code_Line_Visitor::Visit_MinusEquals(const MinusEquals& target)
{
}

void GOAL::Code_Line_Visitor::Visit_TimesEquals(const TimesEquals& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Increment(const Increment& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Decrement(const Decrement& target)
{
}

void GOAL::Code_Line_Visitor::Visit_And(const And& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Or(const Or& target)
{
}

void GOAL::Code_Line_Visitor::Visit_OutputConnection(const OutputConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ArrayAssignmentConnection(const ArrayAssignmentConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_AssignmentRHSConnection(const AssignmentRHSConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ArgumentConnection(const ArgumentConnection& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Array(const Array& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Return(const Return& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Argument(const Argument& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Const(const Const& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ClassMember(const ClassMember& target)
{
}

void GOAL::Code_Line_Visitor::Visit_ClassRef(const ClassRef& target)
{
}

void GOAL::Code_Line_Visitor::Visit_Variable(const Variable& target)
{
}

void GOAL::Code_Line_Visitor::Visit_RootFolder(const RootFolder& target)
{
  // check through the list for code line capable adapters

  std::set <CodeAdapter> codeAdapters = target.CodeAdapter_kind_children ();
  std::set <CodeAdapter>::iterator i = codeAdapters.begin ();

  for (; i != codeAdapters.end (); ++i)
    {
      std::set <CommonConnection> connections = i->CommonConnection_kind_children ();
      std::set <CommonConnection>::iterator j = connections.begin ();

      for (; j != connections.end (); ++j)
        {
          this->Visit_CommonConnection (*j);
        }
    }
}

void GOAL::Code_Line_Visitor::Visit_CommonConnection(const CommonConnection& target)
{
  std::string type (target.type ().name ().operator std::string ());

  if      ("ArgumentConnection" == type)
    {
      GOAL::ArgumentConnection obj = GOAL::ArgumentConnection::Cast (target);
      this->Visit_ArgumentConnection (obj);
    }
  else if ("ArrayAssignmentConnection" == type)
    {
      GOAL::ArrayAssignmentConnection obj = GOAL::ArrayAssignmentConnection::Cast (target);
      this->Visit_ArrayAssignmentConnection (obj);
    }
  else if ("AssignmentConnection" == type)
    {
      GOAL::AssignmentConnection obj = GOAL::AssignmentConnection::Cast (target);
      this->Visit_AssignmentConnection (obj);
    }
  else if ("IndexConnection" == type)
    {
      GOAL::IndexConnection obj = GOAL::IndexConnection::Cast (target);
      this->Visit_IndexConnection (obj);
    }
  else if ("NonModifyingConnection" == type)
    {
      GOAL::NonModifyingConnection obj = GOAL::NonModifyingConnection::Cast (target);
      this->Visit_NonModifyingConnection (obj);
    }
  else if ("OutputConnection" == type)
    {
      GOAL::OutputConnection obj = GOAL::OutputConnection::Cast (target);
      this->Visit_OutputConnection (obj);
    }
  else
    {
      std::string message ("The type " + type + " does not exist in this paradigm. " +
                           "It was registered under a base type of CommonConnection, so " +
                           "this likely means you just need to update your paradigm. Udm sucks.");
      AfxMessageBox(message.c_str ());
    }
}

void GOAL::Code_Line_Visitor::Visit_Object(const Udm::Object& target)
{
}


#endif // CODE_LINE_VISITOR_CPP
